<?php

class AuthUserInterceptor  extends C_Interceptor
{
	public function _begin()
	{
		//获取当前登录用户
		if(Zend_Registry::isRegistered('user_E')) 
		{
			$this->_response->user_E = Zend_Registry::get('user_E');
			$this->_response->is_login = Zend_Registry::get('is_login');
			return ;
		}
		$phpsessid = $this->_request->get('PHPSESSID');
		if(!empty($phpsessid))
		{
			session_id($phpsessid);
		}
		session_start();
	
		$user_E = Weibos::check_login();
		$this->_response->user_E = $user_E;
		Zend_Registry::set('user_E',$user_E);
		//检查是否登录
		if(!empty($user_E))
		{
			$is_login = 1;
		}
		else
		{
			$is_login = 0;
		}
		Zend_Registry::set('is_login',$is_login);
		$this->_response->is_login = $is_login;
	}
	public function _end()
	{
		
		
	}
}
?>